import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yi_shop/route/index.dart';
import 'package:yi_shop/utils/colors.dart';
import 'package:yi_shop/utils/styles.dart';
import 'package:yi_shop/utils/svg.dart';
import 'package:yi_shop/utils/tools.dart';

class InvoiceRiseController extends GetxController {}

class InvoiceRisePage extends GetView<InvoiceRiseController> {
  const InvoiceRisePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: ToolsUtils.builderLeading(),
        title: Text(
          '发票抬头',
          style: StylesUtils.customTextStyle(
              fontWeight: FontWeight.w700, fontSize: StylesUtils.fontSize18),
        ),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: [
            Container(
              margin: EdgeInsets.only(top: 15.h),
              alignment: Alignment.center,
              child: Container(
                width: 335.w,
                height: 111,
                decoration:
                    BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5.r)),
                child: Column(
                  children: [
                    Container(
                      height: 60,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text.rich(TextSpan(children: [
                            WidgetSpan(
                                child: SvgUtils.assetName('u940', width: 30, height: 30),
                                alignment: PlaceholderAlignment.middle),
                            TextSpan(
                                text: ' xxxxx信息技术有限公司',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color3333))
                          ])),
                          Text(
                            '公司',
                            style: StylesUtils.customTextStyle(color: ColorsUtils.color3333),
                          )
                        ],
                      ),
                    ),
                    Container(
                      height: 1,
                      color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorE4e4),
                    ),
                    Container(
                      height: 50,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          TextButton(
                            style: ButtonStyle(
                              minimumSize: const MaterialStatePropertyAll(Size(56, 25)),
                              shape: MaterialStatePropertyAll(RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(5),
                                  side: BorderSide(
                                      color: ColorsUtils.parseColorFromHexString(
                                          ColorsUtils.colorF048)))),
                              alignment: Alignment.center,
                            ),
                            onPressed: () {},
                            child: Text(
                              '默认',
                              style: StylesUtils.customTextStyle(color: ColorsUtils.colorF048),
                            ),
                          ),
                          Text.rich(TextSpan(children: [
                            TextSpan(
                                text: '编辑',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {
                                  Get.toNamed(RoutePath.invoiceModify);
                                }),
                            TextSpan(
                                text: '  |  ',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.colorCccc)),
                            TextSpan(
                                text: '删除',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {}),
                          ]))
                        ],
                      ),
                    )
                  ],
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 15.h),
              alignment: Alignment.center,
              child: Container(
                width: 335.w,
                height: 111,
                decoration:
                    BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5.r)),
                child: Column(
                  children: [
                    Container(
                      height: 60,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text.rich(TextSpan(children: [
                            WidgetSpan(
                                child: SvgUtils.assetName('u940', width: 30, height: 30),
                                alignment: PlaceholderAlignment.middle),
                            TextSpan(
                                text: ' 李白',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color3333))
                          ])),
                          Text(
                            '个人',
                            style: StylesUtils.customTextStyle(color: ColorsUtils.color3333),
                          )
                        ],
                      ),
                    ),
                    Container(
                      height: 1,
                      color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorE4e4),
                    ),
                    Container(
                      height: 50,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          TextButton(
                            style: ButtonStyle(
                              minimumSize: const MaterialStatePropertyAll(Size(56, 25)),
                              shape: MaterialStatePropertyAll(RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(5),
                                  side: BorderSide(
                                      color: ColorsUtils.parseColorFromHexString(
                                          ColorsUtils.colorF048)))),
                              alignment: Alignment.center,
                            ),
                            onPressed: () {},
                            child: Text(
                              '默认',
                              style: StylesUtils.customTextStyle(color: ColorsUtils.colorF048),
                            ),
                          ),
                          Text.rich(TextSpan(children: [
                            TextSpan(
                                text: '编辑',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {}),
                            TextSpan(
                                text: '  |  ',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.colorCccc)),
                            TextSpan(
                                text: '删除',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {}),
                          ]))
                        ],
                      ),
                    )
                  ],
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 15.h),
              alignment: Alignment.center,
              child: Container(
                width: 335.w,
                height: 111,
                decoration:
                    BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5.r)),
                child: Column(
                  children: [
                    Container(
                      height: 60,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text.rich(TextSpan(children: [
                            WidgetSpan(
                                child: SvgUtils.assetName('u940', width: 30, height: 30),
                                alignment: PlaceholderAlignment.middle),
                            TextSpan(
                                text: ' 白居易',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color3333))
                          ])),
                          Text(
                            '个人',
                            style: StylesUtils.customTextStyle(color: ColorsUtils.color3333),
                          )
                        ],
                      ),
                    ),
                    Container(
                      height: 1,
                      color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorE4e4),
                    ),
                    Container(
                      height: 50,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          TextButton(
                            style: ButtonStyle(
                              minimumSize: const MaterialStatePropertyAll(Size(56, 25)),
                              shape: MaterialStatePropertyAll(RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(5),
                                  side: BorderSide(
                                      color: ColorsUtils.parseColorFromHexString(
                                          ColorsUtils.colorF048)))),
                              alignment: Alignment.center,
                            ),
                            onPressed: () {},
                            child: Text(
                              '默认',
                              style: StylesUtils.customTextStyle(color: ColorsUtils.colorF048),
                            ),
                          ),
                          Text.rich(TextSpan(children: [
                            TextSpan(
                                text: '编辑',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {}),
                            TextSpan(
                                text: '  |  ',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.colorCccc)),
                            TextSpan(
                                text: '删除',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {}),
                          ]))
                        ],
                      ),
                    )
                  ],
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 15.h),
              alignment: Alignment.center,
              child: Container(
                width: 335.w,
                height: 111,
                decoration:
                    BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5.r)),
                child: Column(
                  children: [
                    Container(
                      height: 60,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text.rich(TextSpan(children: [
                            WidgetSpan(
                                child: SvgUtils.assetName('u940', width: 30, height: 30),
                                alignment: PlaceholderAlignment.middle),
                            TextSpan(
                                text: ' 陶渊明',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color3333))
                          ])),
                          Text(
                            '个人',
                            style: StylesUtils.customTextStyle(color: ColorsUtils.color3333),
                          )
                        ],
                      ),
                    ),
                    Container(
                      height: 1,
                      color: ColorsUtils.parseColorFromHexString(ColorsUtils.colorE4e4),
                    ),
                    Container(
                      height: 50,
                      padding: const EdgeInsets.symmetric(horizontal: 10),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          TextButton(
                            style: ButtonStyle(
                              minimumSize: const MaterialStatePropertyAll(Size(56, 25)),
                              shape: MaterialStatePropertyAll(RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(5),
                                  side: BorderSide(
                                      color: ColorsUtils.parseColorFromHexString(
                                          ColorsUtils.colorF048)))),
                              alignment: Alignment.center,
                            ),
                            onPressed: () {},
                            child: Text(
                              '默认',
                              style: StylesUtils.customTextStyle(color: ColorsUtils.colorF048),
                            ),
                          ),
                          Text.rich(TextSpan(children: [
                            TextSpan(
                                text: '编辑',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {}),
                            TextSpan(
                                text: '  |  ',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.colorCccc)),
                            TextSpan(
                                text: '删除',
                                style: StylesUtils.customTextStyle(color: ColorsUtils.color9999),
                                recognizer: TapGestureRecognizer()..onTap = () {}),
                          ]))
                        ],
                      ),
                    )
                  ],
                ),
              ),
            ),
            Container(
              margin: const EdgeInsets.only(top: 30),
              alignment: Alignment.center,
              child: TextButton(
                style: ButtonStyle(
                  fixedSize: const MaterialStatePropertyAll(Size(335, 50)),
                  shape: MaterialStatePropertyAll(
                      RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),
                  backgroundColor: MaterialStatePropertyAll(
                      ColorsUtils.parseColorFromHexString(ColorsUtils.colorF048)),
                  alignment: Alignment.center,
                ),
                onPressed: () {
                  Get.toNamed(RoutePath.invoiceModify);
                },
                child: Text(
                  '添加抬头',
                  style: StylesUtils.customTextStyle(),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
